<template>
  <div class="mb6_default c-bg-sgray">
    <div class="c-w100 c-flex-row c-pv20 c-ph30 c-fs24 c-bg-FFE" v-if="isShowMemberTips" @click="linkToVipUpgrade">
      <span class="c-fc-sorange">{{memberTips}}</span>
      <span class="c-fc-smblue">{{'立即续费 >'}}</span>
    </div>
    <div class="c-hh90 c-bg-white c-ph24 c-pt20">
      <div @click="clickGoCourseSearch" class="c-hh50 search-bg c-flex-row c-flex-center">
        <span class="iconfont c-fs24 c-fc-gray">&#xe6d6;</span>
        <span class="c-fs24 c-fc-gray c-ml10">搜索</span>
      </div>
    </div>
    <!--modelType类型说明：
1：轮播图  2：导航栏  3：优惠券  4：课程预告  5：预约师资  6：训练营  7：测评  8：语音评测  9：打卡  10：词典
11：直播专区  12：主播约课  13：课程分类  14：特惠专区  15：知识套餐  16：热门专栏  17：交互测评  18:社群  19:精品课程 20:资料库,21:问答,22:分销商城,23:友情链接,24:公司简介,27线上商城,28开通会员-->
    <section v-for="(_item, _index) in modules" :key="_index">
      <swiper :options="swiperOption" id="swap" ref="swiperMy" v-if="_item.modelType==1 && showSwiperList && _item.items && _item.items.length > 0" class="c-p c-bg-white">
        <swiper-slide v-for="(item, index) in _item.items" :key="index">
          <img @click="swiperClick(item.link)" class="c-w100" :src="$addXossFilter(item.url)" :data-url="item.link" />
        </swiper-slide>
        <div class="swiper-count" slot="pagination"></div>
      </swiper>
      <div class="c-flex-row c-flexw-wrap c-justify-sb c-pv30 c-ph24 c-bg-white" v-if="_item.modelType==2 && _item.items.length > 0">
        <div v-if="!(isiOS && item.navId == 'spread') && !($isWxApp() && item.navId == 'daySign')" @click="clickNavItem(index,item.navId)" v-for="(item,index) in _item.items" :key="index" :style="{width:100/_item.items.length + '%'}" class="c-flex-column  c-justify-sb c-textAlign-c c-cursor-p">
          <img v-if="item.isCustImg" :src="$addXossFilter(item.image)" class="c-ww60 c-hh60 c-br4 c-mlr-auto" alt="" />
          <span v-if="!item.isCustImg" class="iconfont c-fs48" :style="{color:navMap[item.navId] ? navMap[item.navId].color : '#248afd'}" v-html="navMap[item.navId] ? navMap[item.navId].icon : '&#xe65b;'"></span>
          <span class="c-fs20 c-pt16 c-ws-n c-fc-sblack">{{(isBCompany == 1 && item.navId == 'addTeacher') ? '蜜友客服' : item.navText}}</span>
        </div>
      </div>

      <div class="c-hh120 c-bg-white c-ph24 c-pt24 c-mt12" v-if="_item.modelType==28 && userType==1">
        <div @click="linkToVipUpgrade" class="c-hh70 upgrade-bg c-flex-row c-flex-center">
          <span class="iconfont c-fs24 fc-vip">&#xe7d3;</span>
          <span class="c-fs24 c-fc-white c-ml10">会员畅享付费内容，立即开通VIP</span>
        </div>
      </div>

      <!--优惠券-->
      <div class="c-mt12 c-ph24 c-pt24 c-flex-row  c-aligni-end c-bg-white" v-if="_item.modelType==3 && companyAuth.enableRedeemCode == 1 && _item.items.data != null && _item.items.data.length > 0 && !$isWxAppIos()">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
        <span class="c-fs18 c-fc-gray" @click="goValueVoucherList">查看全部</span>
      </div>
      <div class="c-bg-white c-ph24 c-pt30 c-pb34" v-if="_item.modelType==3 && companyAuth.enableRedeemCode == 1 && _item.items.data != null && _item.items.data.length > 0 && !$isWxAppIos()">
        <div class="c-w100 c-contexty-hidden c-contextX-scroll c-ws-n c-pb5">
          <div class="c-inlineblack" v-for="(item,index) in _item.items.data" :key="index">
            <div class="couponStyle c-p c-mr20 " v-if="item.type == 1">
              <div class="exchange-bg c-ph16 c-w100 c-flex-row c-justify-sb c-aligni-center">
                <div class="c-fs34 c-fc-white">兑换券</div>
                <div class="fc-coupon c-fs20 c-bg-white c-ww100 c-hh36 c-lh36 c-textAlign-c c-br20" @click="getCoupon(item.redeemCodeId)">立即领取</div>
              </div>
              <div class="c-fs20 c-fc-sblack c-hh50 c-lh50 c-ph20 c-text-ellipsis1">{{item.name}}</div>
            </div>
            <div class="couponStyle c-p c-mr20 " v-else-if="item.type == 4">
              <div class="coupon-bg c-ph16 c-w100 c-flex-row c-justify-sb c-aligni-center">
                <div class="c-fs34 c-fc-white">抵价券</div>
                <div class="fc-coupon c-fs20 c-bg-white c-ww100 c-hh36 c-lh36 c-textAlign-c c-br20" @click="getCoupon(item.redeemCodeId)">立即领取</div>
              </div>
              <div class="c-fs20 c-fc-sblack c-hh50 c-lh50 c-ph20 c-text-ellipsis1">适用于预约师资功能</div>
            </div>
            <div class="couponStyle c-p c-mr20 " v-else>
              <div class="coupon-bg c-ph16 c-w100 c-flex-row c-justify-sb c-aligni-center">
                <div class="c-fc-white c-flex-column c-justify-sb">
                  <div v-if="item.type == 5" class="c-fs22 c-fw-b"><span class="c-fs42">{{Number(item.price)}}</span>折</div>
                  <div v-else class="c-fs42 c-fw-b"><span class="c-fs22">{{'￥' | iosPriceFilter}}</span>{{Number(item.price)}}</div>
                  <div class="c-fs18">{{Number(item.amount) > 0 ? '满'+Number(item.amount)+'元可用' : '无使用门槛'}}</div>
                </div>
                <div class="fc-coupon c-fs20 c-bg-white c-ww100 c-hh36 c-lh36 c-textAlign-c c-br20" @click="getCoupon(item.redeemCodeId)">立即领取</div>
              </div>
              <div class="c-fs20 c-fc-sblack c-hh50 c-lh50 c-ph20 c-text-ellipsis1">{{item | couponApplyText}}</div>
            </div>
          </div>
        </div>
      </div>

      <!-- 课程预告 -->
      <div class="c-ph24 c-bg-white c-pt24 c-flex-row c-aligni-end c-mt12" v-if="_item.modelType==4 && _item.items != ''">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
        <div>
          <span class="iconfont c-fs18 c-fc-gray">&#xe71f;</span>
          <span class="c-fs18 c-fc-gray c-pl8" @click="clickForenoticeQrcode(_item.items.courseId)">二维码</span>
        </div>
      </div>
      <div @click="clickCourseForenotice(_item.items.courseId)" class="c-ph24 c-pt24 c-flex-row c-pb40 c-bg-white" v-if="_item.modelType==4 && _item.items != ''">
        <div class="c-ww210 c-maxh140 c-text-hidden  c-flex-shrink0 c-br6">
          <div class="c-ww210 c-text-hidden c-br6">
            <img class="c-w100 imgCloseBig" :src="$addXossFilter(_item.items.courseAvatar)" @error="_item.items.courseAvatar = require('../../../assets/defult270.png')" alt="" />
          </div>
        </div>
        <div class="c-pl20 c-w0 c-flex-grow1 c-flex-column c-justify-sb">
          <div class="c-fs24 c-fc-xblack c-text-ellipsis1 c-fw-b">{{_item.items.name}}</div>
          <div class="c-fs18 c-fc-sgray m-8">开课日期：{{_item.items.liveAt}}</div>
          <div class="c-flex-row">
            <span v-if="_item.items.previewTag" :key="index" v-for="(item,index) in _item.items.previewTag" class="forenotice-tag">{{item}}</span>
            <span class="theme-fc c-flex-grow1 c-textAlign-r" :class="_item.items.payType == 1 ? 'c-fs22' : 'c-fs24'">
              <span v-if="_item.items.payType == 2">{{'￥' | iosPriceFilter}}</span>
              <span>{{_item.items.payType | priceValueFilter(_item.items.price, 170)}}</span>
            </span>
          </div>
        </div>
      </div>
      <div class="c-bg-white c-ph24 c-pb36" v-if="_item.modelType==4 && _item.items.desc != '' && _item.items.desc != null">
        <div class="c-pv16 c-ph30 c-bg-fa c-p">
          <div class="c-fs18 c-fc-sblack c-lh36">{{_item.items.desc}}</div>
          <img src="../../../assets/jianjie.png" class="c-pa c-p-t0 c-p-l0 c-ww44 c-hh44" alt="" />
        </div>
      </div>
      <!-- 小班课 -->
      <section class="c-pt24 c-pb20 c-bg-white c-flex-column c-ph24 c-mt12" v-if="_item.modelType==29 && _item.items.data && _item.items.data.length > 0 && companyAuth.enableLivePrivateClass == 1">
        <div class="c-flex-row c-justify-sb c-aligni-end">
          <span class="c-fs28 c-lh c-fw-b">{{_item.name}}</span>
          <span class="c-fs20 c-fc-gray c-pt4 c-ml20 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
          <span class="c-fs18 c-fc-gray c-pl8" @click="clickMoreClassList">查看更多</span>
        </div>
        <class-Item :itemList="_item.items.data" :mb="6"></class-Item>
      </section>

      <!-- 预约师资 -->
      <div v-if="_item.modelType==5 && _item.items.length > 0 && companyAuth.enableReservationModule == 1">
        <div class="c-ph24 c-pt40 c-pb30 c-flex-row c-aligni-center c-bg-white c-mt12">
          <span class="c-fs28 c-lh c-fw-b">{{_item.name}}</span>
          <span class="c-fs20 c-fc-gray c-pt4 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
          <span class="c-fs18 c-fc-gray c-pl8" @click="clickMoreBooking">查看更多</span>
        </div>
        <booking-com :bookingList='_item.items'></booking-com>
      </div>
      <keep-alive>
        <!-- 训练营 -->
        <camp-index-com :trainingName='_item.name' :trainingDesc='_item.desc' :trainingList='_item.items' v-if="_item.modelType==6 && _item.items.length > 0 && companyAuth.enableTrainingModule == 1"></camp-index-com>

        <!-- 打卡 -->
        <clock-index-com :clockInList='_item.items.data' :clockInTitles='_item.name' :clockInDesc='_item.desc' v-if="_item.modelType==9 && _item.items.data.length > 0 && companyAuth.enableSignCardModule == 1"></clock-index-com>

        <!-- 词典 -->
        <word-index-com :wordName="_item.name" :wordDesc="_item.desc" :wordList="_item.items.data" v-if="_item.modelType==10 && _item.items.data.length>0 && companyAuth.enableDictionaryModule == 1"></word-index-com>

        <!-- 直播 -->
        <index-live-com :liveName='_item.name' :liveDesc='_item.desc' :liveList='_item.items.data' v-if="_item.modelType==11 && _item.items.data.length > 0 && companyAuth.enableTeleviseLive == 1"></index-live-com>
        <!-- 直播间 -->
        <index-personallive-com :liveName='_item.name' :liveDesc='_item.desc' :liveList='_item.items.data' v-if="_item.modelType==54 && _item.items.data.length > 0 && companyAuth.enableLivePersonalModule == 1"></index-personallive-com>
        <!-- 约课  -->
        <reservation-item :reservationList="_item.items.data" :reservationTitles='_item.name' :reservationDesc='_item.desc' v-if="_item.modelType==12 && _item.items.data.length > 0 && companyAuth.enableReservationModule == 1"></reservation-item>

        <!-- 面授课  -->
        <edu-index-com :eduList="_item.items.data" :eduName='_item.name' :eduDesc='_item.desc' v-if="_item.modelType==30 && _item.items.data.length > 0 && companyAuth.enableEducationSystemModule == 1"></edu-index-com>

        <!-- 电子书 -->
        <ebooks-item v-if="_item.modelType==34 && _item.items.length > 0 && _item.enableModule == 1 && companyAuth.enableEbookModule == 1" :ebooksName="_item.name" :ebooksDesc="_item.desc" :ebooksList="_item.items"></ebooks-item>
        <!-- 圈子 -->
        <circle-item v-if="_item.modelType == 55 && _item.items.length > 0 && _item.enableModule == 1 && companyAuth.enableCircleModule == 1" :circleName="_item.name" :circleDesc="_item.desc" :circleList="_item.items"></circle-item>
        <!-- 特惠专区 限时购 -->
        <flash-sales-item :bargainList="(_item.items && (companyAuth.enableBargain == 1)) ? _item.items.bargains : []" :collageList="(_item.items && (companyAuth.enableCollage == 1)) ? _item.items.collageList : []" :flashSalesList="(_item.items && (companyAuth.enableFlashSalesModule == 1)) ? _item.items.flashSales.data : []" :friendHelperList="(_item.items && (companyAuth.enableFriendHelper == 1)) ? _item.items.friendHelper : []" :flashSalesTitles='_item.name' :flashSalesDesc='_item.desc' v-if="_item.modelType==14 && _item.items && (_item.items.collageList.length > 0 || _item.items.friendHelper.length > 0 || _item.items.flashSales.data.length > 0 || _item.items.bargains.length > 0) && (companyAuth.enableFlashSalesModule == 1 || companyAuth.enableCollage == 1 || companyAuth.enableFriendHelper == 1 || companyAuth.enableBargain == 1)">
        </flash-sales-item>

        <!-- 知识套餐 -->
        <package-index-com :packageList='_item.items.data' :packageTitles='_item.name' :packageDesc='_item.desc' v-if="_item.modelType==15 && _item.items.data.length > 0 && companyAuth.enableComboModule == 1"></package-index-com>
        <!-- 交互测评 -->
        <mutua-index-com :mutuaList='_item.items.data' :mutuaTitles='_item.name' :mutuaDesc='_item.desc' v-if="_item.modelType==17 && _item.items.data.length > 0 && companyAuth.enableMutualTestModule == 1"></mutua-index-com>
        <!-- 语音测试 -->
        <voice-index-com :voiceList='_item.items.data' :mutuaTitles='_item.name' :mutuaDesc='_item.desc' v-if="_item.modelType==8 && _item.items.data.length > 0 && companyAuth.enableSpeechTestModule == 1"></voice-index-com>
        <!-- 活动 -->
        <activity-item :activityName="_item.name" :activityDesc="_item.desc" :itemList="_item.items" v-if="_item.modelType==32 && _item.items.length>0 && companyAuth.enableActivityModule == 1"></activity-item>
        <!-- 分销商城 -->
        <distribution-index-com :distributionName="_item.name" :distributionDesc="_item.desc" :distributionList="_item.items.data" v-if="_item.modelType==22 && _item.items.data.length > 0 && companyAuth.enableDistributionMarketModule"></distribution-index-com>
      </keep-alive>
      <!-- 课程分类 -->
      <div class="c-ph24 c-bg-white c-pt24 c-mt12 c-flex-row c-aligni-end" v-if="_item.modelType==13 && courseCategory.length > 0">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
        <span class="c-fs18 c-fc-gray" @click="clickAllCategory" v-if="_item.categoriesCount > 4">全部分类</span>
      </div>
      <div class="c-bg-white c-ph24 c-pb40" v-if="_item.modelType==13 && courseCategory.length > 0">
        <div v-for="(item,index) in courseCategory" :key="index" class="c-flex-row  c-pt24" @click="clickSubCategory(item.level1CatId,item.level2CatId,item.level3CatId,item.name)">
          <div class="c-ww160 c-maxh106 c-text-hidden c-flex-shrink0 c-br6">
            <div class="c-ww160 c-text-hidden c-br6">
              <img class="c-w100 imgCloseBig" :src="$addXossFilter(item.avatar, require('../../../assets/defult270.png'))" @error="item.avatar = require('../../../assets/defult270.png')" />
            </div>
          </div>
          <div class="c-flex-grow1 c-w0 c-pl20 c-flex-column" :class="(index+1) == courseCategory.length?'':'c-pb24 c-bd-b1-item'">
            <div class="c-fs24 c-fc-xblack c-text-ellipsis1 c-fw-b">{{item.name}}</div>
            <div class="c-fs18 c-fc-gray c-text-ellipsis2 c-mt8 c-hh60 c-lh30">{{item.courseSecondCategory!=""?"包括："+item.courseSecondCategory:""}}</div>
          </div>
        </div>
      </div>

      <!-- 专栏 -->
      <div class="c-ph24 c-bg-white c-pt24 c-mt12 c-flex-row c-aligni-end" v-if="_item.modelType==16 && _item.items.length > 0 && companyAuth.enableColumnModule == 1">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
        <span class="c-fs18 c-fc-gray" @click="goColumn">全部专栏</span>
      </div>
      <div class="c-bg-white c-ph24 c-pb40" v-if="_item.modelType==16 && _item.items.length > 0 && companyAuth.enableColumnModule == 1">
        <div v-for="(item,index) in _item.items" :key="index" class="c-flex-row  c-pt24" @click="clickColumn(item.columnId)">
          <div class="c-ww160 c-maxh106 c-text-hidden c-flex-shrink0 c-br6">
            <div class="c-ww160 c-text-hidden c-br6 c-p">
              <img class="c-w100 imgCloseBig" :src="$addXossFilter(item.cover)" @error="item.cover = require('../../../assets/defult270.png')" />
            </div>
          </div>
          <div class="c-flex-grow1 c-w0 c-pl20 c-flex-column" :class="(index+1) == _item.items.length?'':'c-pb24 c-bd-b1-item'">
            <div class="c-fs24 c-fc-xblack c-text-ellipsis1 c-fw-b">{{item.name}}</div>
            <div class="c-fs18 c-fc-gray c-text-ellipsis1 c-mt8 c-hh28">{{item.desc}}</div>
            <div class="c-flex-row c-aligni-end c-mt6">
              <div class="c-flex-grow1 c-flex-row">
                <div class="c-fs18 c-fc-gray" v-if="item.isUpdating == 1 && enableColumnRelates == 1">已更新{{item.hasCourse}}集</div>
                <div class="c-fs18 c-fc-gray" v-if="item.isUpdating == 0 && enableColumnRelates == 1">共{{item.hasCourse}}集</div>
                <div class="c-fs18 c-fc-gray c-mh4px c-pt4" v-if="enableColumnRelates == 1 && (enableShowModuleView == 1 || !(enableHiddenModules && enableHiddenModules.includes(9)))">|</div>
                <div v-if="item.payType == 2 && (enableShowModuleView == 1 || !(enableHiddenModules && enableHiddenModules.includes(9)))" class="c-fs18 c-fc-gray">{{(item.initSales + item.subscribers) | formatNumber}}人{{$isWxAppIos() ? '观看' : '购买'}}</div>
                <div v-else-if="enableShowModuleView == 1 || !(enableHiddenModules && enableHiddenModules.includes(9))" class="c-fs18 c-fc-gray">{{item.clicks | formatNumber}}次观看</div>
              </div>
              <div class="c-flex-row c-aligni-center">
                <div class="free-tag theme-fc theme-bd1" v-if="item.vipDiscount==0 && item.payType == 2">VIP免费</div>
                <div class="free-tag theme-fc theme-bd1" v-if="item.svipDiscount==0 && item.vipDiscount!=0 && item.payType == 2">SVIP免费</div>
                <div class="theme-fc" :class="Number(item.price) == 0 ? 'c-fs22' : 'c-fs24'">
                  <span v-if="item.payType == 2">{{'￥' | iosPriceFilter}}</span>{{item.payType | priceValueFilter(item.price, 9)}}
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 考考你 -->
      <div class="c-ph24 c-bg-white c-pt24 c-mt12 c-flex-row c-aligni-end" v-if="_item.modelType==7 && _item.items.data.length > 0 && companyAuth.enableExamModule == 1">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
        <span class="c-fs18 c-fc-gray" @click="clickMoreExamination">全部测试</span>
      </div>
      <div class="c-bg-white c-ph24 c-pb40" v-if="_item.modelType==7 && _item.items.data.length > 0 && companyAuth.enableExamModule == 1">
        <div v-for="(item,index) in _item.items.data" :key="index" class="c-flex-row  c-pt24" @click="clickExaminationItem(item.topicId)">
          <div class="c-ww140 c-maxh140 c-text-hidden c-flex-shrink0 c-br6">
            <div class="c-ww140 c-text-hidden c-br6">
              <img class="c-w100 imgCloseBig" :src="$addXossFilter(item.avatar, require('../../../assets/examination_defult.png'))" @error="item.avatar = require('../../../assets/examination_defult.png')" alt="" />
            </div>
          </div>
          <div class="c-flex-grow1 c-w0 c-pl20 c-flex-column c-justify-sb" :class="(index+1) == _item.items.data.length?'':'c-pb24 c-bd-b1-item'">
            <div class="c-fs24 c-fc-xblack c-text-ellipsis1 c-fw-b">{{item.name}}</div>
            <div class="c-fs18 c-fc-gray c-text-ellipsis2 c-lh28">{{item.desc}}</div>
            <div class="c-flex-row c-aligni-end">
              <div class="c-flex-grow1 c-flex-row">
                <div class="c-fs18 c-fc-gray">考试{{item.hasPaper}}套</div>
                <div class="c-fs18 c-fc-gray c-mh4px c-pt4">|</div>
                <div class="c-fs18 c-fc-gray">{{item.subscribers}}人已{{item.price * 1 > 0 ? '购买':'测'}}</div>
              </div>
              <div class="c-flex-row c-aligni-center">
                <div class="free-tag theme-fc theme-bd1" v-if="item.price != '0.00' && item.svipDiscount==0 && item.vipDiscount!=0">SVIP免费</div>
                <div class="free-tag theme-fc theme-bd1" v-if="item.price != '0.00' && item.vipDiscount==0">VIP免费</div>
                <div class="theme-fc" :class="item.payType==2 ? 'c-fs24' : 'c-fs22'">
                  <span>
                    <span v-if="item.payType==2">{{'￥' | iosPriceFilter}}</span>{{item.payType | priceValueFilter(item.price, 11)}}
                  </span>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!--考试-->
      <section class="c-mt12 c-pv24 c-ph24 c-bg-white c-flex-column" v-if="_item.modelType == 31 && _item.enableModule == 1 && _item.items.data.length > 0 && companyAuth.enableExamModule == 1">
        <div class="c-flex-row c-justify-sb c-aligni-end">
          <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name ? _item.name : '考试'}}</span>
          <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
          <span class="c-fs18 c-fc-gray c-pl8" :class="_item.isShowMore==1?'hide':''" @click="clickMoreTestPaper">{{'查看更多'}}</span>
        </div>
        <testPaper-item :itemList="_item.items.data" :isFromM7="false" :itemType="1" :showCount="_item.items.count"></testPaper-item >
      </section>
      <!--练习-->
      <section class="c-mt12 c-pv24 c-ph24 c-bg-white c-flex-column" v-if="_item.modelType == 33 && _item.enableModule == 1 && _item.items.data.length > 0 && companyAuth.enableQuestionBankModule == 1">
        <div class="c-flex-row c-justify-sb c-aligni-end">
          <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name ? _item.name : '练习'}}</span>
          <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
          <span class="c-fs18 c-fc-gray c-pl8" :class="_item.isShowMore==1?'hide':''" @click="clickMoreQuestion">{{'查看更多'}}</span>
        </div>
        <question-item :itemList="_item.items.data" :isFromM7="false" :itemType="1" :showCount="_item.items.count"></question-item>
      </section>
      <!-- 社群 -->
      <div class="c-ph24 c-bg-white c-pt24 c-mt12 c-flex-row c-aligni-end" v-if="_item.modelType==18 && _item.items.length > 0 && companyAuth.enableSocialGroup == 1">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
        <span class="c-fs18 c-fc-gray" @click="clickMoreSocialGroup">全部社群</span>
      </div>
      <div class="c-bg-white c-ph24 c-pb40" v-if="_item.modelType==18 && _item.items.length > 0 && companyAuth.enableSocialGroup == 1">
        <div class="c-flex-row c-pt24" v-for="(item,index) in _item.items" :key="index">
          <div class="c-ww100 c-hh100 c-brp50 c-text-hidden c-flex-shrink0">
            <img class="imgCloseBig" :src="$addXossFilter(item.avatar)" />
          </div>
          <div class="c-flex-grow1 c-w0 c-flex-row c-pl20 c-aligni-center" :class="(index+1) == _item.items.length?'':'c-pb24 c-bd-b1-item'">
            <div class="c-flex-grow1 c-flex-column c-w0 c-pr24">
              <div class="c-fs24 c-fc-xblack c-text-ellipsis1">{{item.name}}</div>
              <div class="c-fs18 c-fc-gray c-text-ellipsis1 c-mt10 c-hh28">{{item.intro}}</div>
              <div class="c-mt10 c-fs18 c-fc-gray">{{item.number}}人已加入</div>
            </div>
            <div @click="clickSocailGroupItem(item.socialRoomId)" class="c-fs22 c-fc-white c-br6 c-ww90 c-hh44 c-flex-center c-flex-row theme-bg">加入</div>
          </div>
        </div>
      </div>

      <!-- 精品课程 -->
      <div class="c-ph24 c-bg-white c-pt24 c-mt12 c-flex-row c-aligni-end" v-if="_item.modelType==19">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
        <span class="c-fs18 c-fc-gray" @click="clickGoCourse">更多课程</span>
      </div>
      <div class="c-bg-white c-pt24 c-pb40 c-ph24" v-if="_item.modelType==19">
        <div class="c-flex-row c-fs20 c-textAlign-c c-fc-gray c-justify-sa">
          <div class="c-flex-row c-flex-center c-ww110 c-hh44 c-bd1-mgray c-br36" :class="courseType == 0 ? 'c-fc-sblack c-bd1-sblack' : ''" @click="changeType(0)">全部</div>
          <div class="c-flex-row c-flex-center c-ww110 c-hh44 c-bd1-mgray c-br36" :class="courseType == 1 ? 'c-fc-sblack c-bd1-sblack' : ''" @click="changeType(1)">视频</div>
          <div class="c-flex-row c-flex-center c-ww110 c-hh44 c-bd1-mgray c-br36" :class="courseType == 2 ? 'c-fc-sblack c-bd1-sblack' : ''" @click="changeType(2)">音频</div>
          <div class="c-flex-row c-flex-center c-ww110 c-hh44 c-bd1-mgray c-br36" :class="courseType == 3 ? 'c-fc-sblack c-bd1-sblack' : ''" @click="changeType(3)">文章</div>
        </div>
        <div v-for="(item,index) in excellentCourse" :key="index" class="c-flex-row  c-pt24" @click="clickCourseItem(item.courseId,item.courseType)">
          <div class="c-ww160 c-maxh106 c-text-hidden c-flex-shrink0 c-br10">
            <div class="c-ww160 c-maxh106 c-text-hidden c-br10 c-p">
              <img class="c-w100 imgCloseBig" :src="$addXossFilter(item.courseAvatar, require('../../../assets/defult270.png'))" @error="item.courseAvatar = require('../../../assets/defult270.png')" alt="" />
              <img class="icon-course-mark" v-if="item.courseType == 0 " src="../../../assets/i/wap/course/icon_type_video.png" alt="" />
              <img class="icon-course-mark" v-else-if="item.courseType == 1 " src="../../../assets/i/wap/course/icon_type_audio.png" alt="" />
              <img class="icon-course-mark" v-else src="../../../assets/i/wap/course/icon_type_pic.png" alt="" />
              <vip-status :item="item"></vip-status>
            </div>
          </div>
          <div class="c-flex-grow1 c-w0 c-pl20 c-flex-column" :class="(index+1) == excellentCourse.length?'':'c-pb24 c-bd-b1-item'">
            <div class="c-fs24 c-fc-xblack c-text-ellipsis1 c-fw-b">{{item.name}}</div>
            <div class="c-fs18 c-fc-gray c-text-ellipsis1 c-mt8 c-hh28">{{item.desc}}</div>
            <div class="c-flex-row c-aligni-end c-mt6">
              <div v-if="enableShowModuleView == 1 || !(enableHiddenModules && enableHiddenModules.includes(5))" class="c-flex-grow1 c-flex-row c-text-hidden">
                <div class="c-fs18 c-fc-gray c-text-ellipsis1">{{item.plays | formatNumber}}次观看</div>
              </div>
              <div class="c-flex-row c-aligni-center">
                <div class="c-ws-n free-tag theme-fc theme-bd1 c-mr4" v-if="(item.allowWholeWatch == 1 || (item.watchPermission == 1 && item.watchTime > 0)) && item.payType == 2 && item.courseType != 2">{{item.courseType == 1 ? '可试听':'可试看'}}</div>
                <div class="c-ws-n free-tag theme-fc theme-bd1" v-if="item.payType == 2 && item.vipDiscount == 0">VIP免费</div>
                <div class="c-ws-n free-tag theme-fc theme-bd1" v-if="item.payType == 2 && item.svipDiscount == 0 && item.vipDiscount != 0">SVIP免费</div>
                <div class="c-ws-n theme-fc" :class="item.payType == 1 ? 'c-fs22' : 'c-fs24'">
                  <span v-if="item.payType == 2">{{ "￥" | iosPriceFilter }}</span>{{item.payType | priceValueFilter(item.price, 5)}}
                </div>
              </div>
            </div>
          </div>
        </div>
        <loading-status-tem :noData="excellentCourse.length == 0 && loadingStatus == 'LOAD_END'" :noDataText="'暂无课程'"></loading-status-tem>
      </div>

      <!-- 资料库 -->
      <div class="img-database c-mt12" @click="clickGoDatum" v-if="_item.modelType==20 && companyAuth.enableDatumModule == 1">
        <img src="https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/index/img_datum_mb6.png" alt="" class="imgCloseBig" />
      </div>

      <!-- 问答 -->
      <div class="c-ph24 c-bg-white c-pt24 c-mt12 c-flex-row c-aligni-end" v-if="_item.modelType==21 && companyAuth.enableQuestionModule == 1 && _item.items.status == 1">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
        <span class="c-fs18 c-fc-gray" @click="clickGoQA">查看问答</span>
      </div>

      <div class="c-ph24 c-pt24 c-pb40 c-flex-row c-bg-white" @click="clickGoQA" v-if="_item.modelType==21 && companyAuth.enableQuestionModule == 1 && _item.items.status == 1">
        <div class="c-ww210 c-hh140 c-text-hidden c-br6">
          <div class="c-ww210 c-text-hidden c-br6">
            <img class="c-w100" :src="$addXossFilter(_item.items.cover)" alt="" />
          </div>
        </div>
        <div class="c-pl20 c-flex-grow1 c-w0 c-flex-column c-justify-sb">
          <div class="c-fs28 c-text-ellipsis1 c-fw-b">{{_item.items.title}}</div>
          <div class="c-fs20 c-fc-gray c-text-ellipsis2">{{_item.items.describe}}</div>
          <div class="c-fs20 theme-fc">{{questionCount}}个问答</div>
        </div>
      </div>

      <!-- 实体商城 -->
      <div class="c-ph24 c-bg-white c-pt24 c-mt12 c-flex-row c-aligni-end" v-if="_item.modelType==27 && _item.items.length > 0 && companyAuth.enableMallModule == 1">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
        <span class="c-fs18 c-fc-gray" @click="clickGoShop">进入商城</span>
      </div>
      <div class="c-bg-white c-ph24 c-pb20" v-if="_item.modelType==27 && _item.items.length > 0 && companyAuth.enableMallModule == 1">
        <div v-for="(item,index) in _item.items" :key="index" class="c-flex-row c-pt24" @click="clickShop(item.mgId)">
          <div class="c-pb24">
            <div class="c-ww140 c-maxh140 c-text-hidden c-flex-shrink0 c-br6">
              <div class="c-ww140 c-text-hidden c-br6">
                <img class="c-w100 imgCloseBig" :src="$addXossFilter(item.avatar, require('../../../assets/defult270.png'))" @error="item.avatar = require('../../../assets/defult270.png')" alt="" />
              </div>
            </div>
          </div>
          <div class="c-flex-grow1 c-w0 c-pl20 c-flex-column c-justify-sb c-pb24" :class="(index+1) == _item.items.length?'':'c-bd-b1-item'">
            <div class="c-fs24 c-fc-xblack c-text-ellipsis1 c-fw-b">{{item.name}}</div>
            <div class="c-aligni-center c-flex-row c-flexw-wrap" v-if="item.cashBack && item.cashBack.detail">
              <span class="c-mr12 c-fs18 c-pv2 c-ph12 theme-bd1 c-br2 theme-fc" v-if="item.cashBack.isDiscount == 1">{{item.cashBack.detail.title + item.cashBack.detail.amount}}</span>
              <span class="c-fs18 c-pv2 c-ph12 theme-bd1 c-br2 theme-fc" v-if="item.cashBack.isFreeShipping == 1">
                {{item.cashBack.detail.title}}包邮
              </span>
            </div>
            <div class="c-flex-row c-fs18 c-fc-gray c-text-ellipsis1">
              <span class="shop-tag" v-if="item.postage=='0.00'">包邮</span>
            </div>
            <div class="c-flex-row c-aligni-end">
              <div class="c-flex-grow1 c-flex-row">
                <div class="c-fs18 c-fc-gray">{{item.sales}}人已购买</div>
              </div>
              <span class="theme-fc c-flex-grow1 c-textAlign-r" :class="Number(item.price) == 0 ? 'c-fs22' : 'c-fs24'"><span v-if="Number(item.price) != 0">{{'￥' | iosPriceFilter}}</span>{{item.price | moneyStr}}</span>
            </div>
          </div>
        </div>
      </div>

      <!-- 友商链接 -->
      <div class="c-mt12 c-ph24 c-pt24 c-flex-row  c-aligni-end c-bg-white" v-if="_item.modelType==23 && _item.items.length > 0">
        <span class="c-fs28 c-fc-xblack c-fw-b">{{_item.name}}</span>
        <span class="c-fs20 c-fc-gray c-mb2 c-ml16 c-w0 c-flex-grow1 c-mr16 c-text-ellipsis1">{{_item.desc}}</span>
      </div>
      <div class="c-bg-white c-ph24 c-pt24 c-pb40 c-bd-b1" v-if="_item.modelType==23 && _item.items.length > 0">
        <div class="c-w100 c-hh100 c-contexty-hidden c-contextX-scroll c-ws-n">
          <div v-for="(item,index) in _item.items" :key="index" @click="clickFirendLink(item.link)" class="c-inlineblack c-textAlign-c c-ww190 c-hh100 c-text-hidden c-bd1" :class="index == _item.items.length - 1 ? '':'c-mr10'">
            <img class="c-w100 imgCloseBig" :src="$addXossFilter(item.url)" alt="" />
          </div>
        </div>
      </div>

      <div class="c-mt12 c-pv24 c-flex-row c-fs30 c-bg-white" v-if="_item.modelType==24">
        <div class="c-fs24 c-fc-xblack c-w0 c-flex-grow1 c-textAlign-c" @click="clickCompanyIntro">公司简介</div>
        <div class="c-fs24 c-fc-xblack c-w0 c-flex-grow1 c-textAlign-c" @click="clickContactUs">联系我们</div>
      </div>
    </section>
  </div>
</template>

<script>
import { utilJs } from "@/utils/common.js";
import 'swiper/dist/css/swiper.css'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import questionItem from "@/components/templates/questionItem.vue";
import loadingStatusTem from "@/components/templates/common/loadingStatusTem.vue";
import indexLiveCom from "@/components/templates/indexLiveCom.vue";
import wordIndexCom from "@/components/templates/wordIndexCom.vue";
import clockIndexCom from "@/components/templates/clockIndexCom.vue";
import TestPaperItem from "@/components/templates/testPaperItem.vue";
import packageIndexCom from "@/components/templates/packageIndexCom.vue";
import mutuaIndexCom from "@/components/templates/mutuaIndexCom.vue";
import voiceIndexCom from "@/components/templates/voiceIndexCom.vue";
import reservationItem from "@/components/templates/reservationItem.vue";
import distributionIndexCom from "@/components/templates/distributionIndexCom.vue";
import flashSalesItem from "@/components/templates/flashSalesItem.vue";
import campIndexCom from "@/components/templates/campIndexCom.vue";
import bookingCom from "@/components/templates/bookingCom.vue";
import classItem from '@/components/templates/classItem.vue';
import eduIndexCom from '@/components/templates/eduIndexCom.vue';
import activityItem from "@/components/templates/activityItem.vue";
import ebooksItem from "@/components/templates/ebooks/ebooksItem.vue";
import circleItem from "@/components/templates/circle/circleItem.vue";
import { goDetails } from "@/utils/goDetails.js"
import indexPersonalliveCom from "@/components/templates/indexpersonalliveCom.vue";
import vipStatus from '@/components/templates/common/vipStatus.vue';
import { officialIndex } from "@/mixin/officialIndex.js";
let courseAllList = [];
let courseVideoList = [];
let courseAudioList = [];
let coursePicList = [];
export default {
  name: "IndexSix",
  mixins: [officialIndex],
  components: {
    swiper,
    swiperSlide,
    loadingStatusTem,
    indexPersonalliveCom,
    clockIndexCom,
    indexLiveCom,
    packageIndexCom,
    reservationItem,
    distributionIndexCom,
    flashSalesItem,
    wordIndexCom,
    mutuaIndexCom,
    campIndexCom,
    voiceIndexCom,
    bookingCom,
    classItem,
    eduIndexCom,
    activityItem,
    questionItem,
    ebooksItem,
    TestPaperItem,
    circleItem,
    vipStatus
  },
  props: {
  },
  data() {
    return {
      categoryLevel: localStorage.getItem("categoryLevel") ? Number(localStorage.getItem("categoryLevel")) : 1,
      categoryTheme: JSON.parse(localStorage.getItem("categoryTheme")),
      getAlready: false,
      showSwiperList: true, //解决回到首页轮播图不轮播bug
      cfrom: global.ckFrom,
      isBCompany: localStorage.getItem("companyId") == "ldwk" ? 1 : 0,
      loadingStatus: "LOADING",
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
      navMap: {
        agent: {
          icon: "&#xe7d6;",
          color: "#248afd",
          link: "/homePage/agent/agentIndex"
        },
        column: {
          icon: "&#xe7cf;",
          color: "#248afd",
          link: "/homePage/column/columnList"
        },
        online: {
          icon: "&#xe7d8;",
          color: "#248afd",
          link: "/homePage/course/courseList"
        },
        addTeacher: {
          icon:
            localStorage.getItem("companyId") == "ldwk"
              ? "&#xe7da;"
              : "&#xe7da;",
          color: "#248afd",
          link: ""
        },
        history: {
          icon: "&#xe7dd;",
          color: "#248afd",
          link: "/member/watchList/watchList?ckFrom=" + global.ckFrom.course
        },
        mall2: {
          icon: "&#xe7df;",
          color: "#248afd",
          link: `/homePage/microPage/microPage?mId=${JSON.parse(localStorage.getItem("companyAuth")).mallPageId}`,
        },
        gzhShow: {
          icon: "&#xe7d0;",
          color: "#248afd",
          link: ""
        },
        upgradeVip: {
          icon: "&#xe7d7;",
          color: "#248afd",
          link: "/member/vip/vipUp"
        },
        spread: {
          icon: "&#xe8a9;",
          color: "#248afd",
          link: "/homePage/spread/SpreadMoney"
        },
        activity: {
          icon: "&#xe7de;",
          color: "#248afd",
          link: "/activity/activityIndex"
        },
        examTopic: {
          icon: "&#xe7e1;",
          color: "#248afd",
          link: "/homePage/examination/examinationList"
        },
        datum: {
          icon: "&#xe7e0;",
          color: "#248afd",
          link: "/homePage/datum/datumList"
        },
        social: {
          icon: "&#xe7db;",
          color: "#248afd",
          link: "/homePage/socialGroup/socialGroupList"
        },
        question: {
          icon: "&#xe7b7;",
          color: "#248afd",
          link: "/homePage/qa/answerLord"
        },
        category: {
          icon: "&#xe7d4;",
          color: "#248afd",
          link: "/homePage/course/courseCategory"
        },
        televiseLive: {
          icon: "&#xe7f9;",
          color: "#248afd",
          link: "/homePage/live/liveList"
        },
        signHomework: {
          icon: "&#xe81c;",
          color: "#248afd",
          link: "/homePage/clockIn/clockInList"
        },
        reservation: {
          icon: "&#xe854;",
          color: "#248afd",
          link: "/homePage/reservation/reservationList"
        },
        dictionary: {
          icon: "&#xe877;",
          color: "#248afd",
          link: "/homePage/word/wordList",
        },
        daySign: {
          icon: "&#xe903;",
          color: "#5491ff",
          link: "/member/myIntegral/integralIndex",
          navText: "日历签到"
        },
        appointment: {
          icon: "&#xe8d0;",
          color: "#248afd",
          link: "/homePage/booking/bookingList",
          navText: "约课"
        },
        privateClass: {
          icon: "&#xe90a;",
          color: '#248afd',
          link: "/homePage/privateClass/classList",
          navText: "小班课"
        },
        educationSystem: {
          icon: "&#xe90d;",
          color: "#248afd",
          link: "/edu/eduList",
          navText: "面授课"
        },
      },
      isShowMemberTips: false, // 是否显示续费
      memberTips: "您的会员即将到期，请续费~", // 会员提示语
      userRole: 1, //当前用户身份 1普通用户； 2高级会员（开通年会员99元）3 代理商 4 svip 5.合伙人 6.分公司
      courseType: 0,
      excellentCourse: [], //精品课程
      courseCategory: [], //课程分类
      isiOS: navigator.userAgent.indexOf('IOSLogin') > -1 || navigator.userAgent.indexOf('IOSNewLogin') > -1 || navigator.userAgent.indexOf("IOSNewApp") > -1,
      questionCount: 0,
      showExpire: false, // 时间是否到期
      swiperCount: 0,
      userType: -1,
      isShowCS: false, //客服
      swiperOption: {
        pagination: {
          el: '.swiper-count',
          bulletActiveClass: 'theme-bg',
          type: 'fraction'
        },
        loop: true,
        speed: 300,
        autoplay: {
          disableOnInteraction: false,
        },
        autoHeight: true,
        updateOnImagesReady: true,
        observer: true,
        on: {
          tap: function (event) {
            let linkUrl = event.srcElement.dataset.url;
            if (linkUrl) {
              if (!linkUrl.includes("http") && !linkUrl.includes("https")) {
                linkUrl = "http://" + linkUrl;
              }
              utilJs.locationHref(linkUrl, this);
            }
          },
        },
      },
      modules: [],
      enableShowModuleView: localStorage.getItem("cfg") ? JSON.parse(localStorage.getItem("cfg")).enableShowModuleView : 1,
      enableHiddenModules: localStorage.getItem("cfg") ? JSON.parse(localStorage.getItem("cfg")).enableHiddenModules : [],
      enableColumnRelates: localStorage.getItem("cfg") ? JSON.parse(localStorage.getItem("cfg")).enableColumnRelates : 1,
    };
  },

  activated() {
    this.showSwiperList = false;
    this.$nextTick(() => {
      this.showSwiperList = true;
    });
  },
  deactivated() { },
  mounted() {
    this.companyAuth = JSON.parse(localStorage.getItem("companyAuth"));
    let expireTime = new Date().getTime() + 1000 * 60;
    // 解决有时候白屏问题
    if (this.companyAuth) {
        expireTime = utilJs.getTimeByDate(this.companyAuth.expireTime);
    }
    // 判断体验版是否到期，到期之后不可购买商品
    this.showExpire = expireTime - (new Date()).getTime() < 0
    if (!this.showExpire) {
      this.courseType = 0;
      courseAllList = [];
      courseVideoList = [];
      courseAudioList = [];
      coursePicList = [];
      this.loadingStatus = "LOADING";
      this.getIndexInfo();
    } else {
      let isExireTime = new Date().getTime() - expireTime > 7776000000; // 过期时间超过3个月
      this.$cjConfirm({
        title: '店铺已打烊',
        message: `打烊期间无法购买商品，${isExireTime ? '无法访问!' : '所有服务停止!'}`,
        showCancelButton: false,
        clickCloseModal: false,
        onConfirm:() => {
           // 店铺已打烊提示消失后执行
          this.courseType = 0;
          courseAllList = [];
          courseVideoList = [];
          courseAudioList = [];
          coursePicList = [];
          this.loadingStatus = "LOADING";
          this.getIndexInfo();
        }
      })
    }
    this.$nextTick(function () {
      window.addEventListener('scroll', this.swiperScroll);
    });
  },
  computed: {},
  watch: {
    $route(to, from) {
      if (to.path == "/") {
        this.courseType = 0;
        courseAllList = [];
        courseVideoList = [];
        courseAudioList = [];
        coursePicList = [];
        this.loadingStatus = "LOADING";
        this.getIndexInfo();
      }
    }
  },
  methods: {
    swiperClick(linkUrl) {
      if (linkUrl) {
        if (!linkUrl.includes("http") && !linkUrl.includes("https")) {
          linkUrl = "http://" + linkUrl;
        }
        utilJs.locationHref(linkUrl, this);
      }
    },
    swiperScroll: function () {
      let swap = document.getElementById('swap');
      let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
      let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
      if (!swap) { return; }
      if (swap.offsetTop > scrollTop + clientHeight || swap.offsetTop + swap.offsetHeight < scrollTop) {
        if (this.$refs.swiperMy[0].swiper != undefined) {
          this.$refs.swiperMy[0].swiper.autoplay.stop();
        }
      } else {
        if (this.$refs.swiperMy[0].swiper != undefined) {
          this.$refs.swiperMy[0].swiper.autoplay.start();
        }
      }
    },
    //获取首页相关数据
    getIndexInfo() {
      let that = this;
      this.showSwiperList = false;
      this.$nextTick(() => {
        this.showSwiperList = true;
      });
      utilJs.getMethod(global.apiurl + "company/getOfficialIndex?mb=6", function (res) {
        that.companyAuth = JSON.parse(localStorage.getItem("companyAuth"));
        that.$store.commit('updateUserVipType', res.userType);
        localStorage.setItem(
          "vipType" + res.userId,
          res.userType
        );
        if (
          (res.userType == 2 || res.userType == 4) &&
          res.vipDay <= 7 &&
          res.vipDay >= 0
        ) {
          let userTypeName = res.userType == 2 ? 'VIP' : 'SVIP';
          if (Number(res.vipDay) == 0) {
            that.memberTips =
            "您的" + userTypeName + "会员今天过期，";
          } else {
            that.memberTips =
            "您的" + userTypeName + "会员还有" + res.vipDay + "天过期，";
          }
          that.isShowMemberTips = true;
        } else {
          that.isShowMemberTips = false;
        }
        that.userType = res.userType;
        that.userRole = res.userType;
        that.modules = res.modules;
        that.modules.forEach(el => {
          if (el.modelType == 1 && el.items.length == 1) {
            that.swiperOption.autoplay = false;
            that.swiperOption.loop = false;
          }
          if (el.modelType == 13 && el.isShowModule == 1) {
            // 新版结构课程分类赋值
            that.courseCategory = el.items;
          }
          if (el.modelType == 19 && el.isShowModule == 1) {
            courseAllList = el.items.course.data;
            courseVideoList = el.items.videoCourse.data;
            courseAudioList = el.items.audioCourse.data;
            coursePicList = el.items.articleCourse.data;
          }
        })
        that.excellentCourse = [...courseAllList];
        that.questionCount = res.questionCount;
        that.loadingStatus = "LOAD_END";
        window.localStorage.setItem("shareTitle", res.shareDesc.shareTitle);
        window.localStorage.setItem("shareDesc", res.shareDesc.shareDesc);
        window.localStorage.setItem("shareLogo", res.shareDesc.logo);

        for (var i = 0; i < that.courseCategory.length; i++) {
          var catStr = "";
          var catArr = [];
          for (var j = 0; j < that.courseCategory[i].secondCategory.length; j++) {
            catArr.push(that.courseCategory[i].secondCategory[j].name);
            catStr = catArr.join(" | ");
          }
          that.courseCategory[i].courseSecondCategory = catStr;
        }

        let title = window.localStorage.getItem("shareTitle") || window.localStorage.getItem("companyName");
        let shareImg = res.shareDesc.logo;
        let shareUrl =
          window.location.href.split("#")[0] +
          "#" +
          that.$route.path +
          "?&refereeId=" +
          localStorage.getItem("userId");
        let shareDesc = res.shareDesc.shareDesc;
        utilJs.wechatConfig(
          shareUrl,
          title,
          shareImg,
          shareDesc,
          function () { }
        );
      });
    },
    changeType(tabIndex) {
      this.courseType = tabIndex;
      switch (tabIndex) {
        case 0:
          this.excellentCourse = [...courseAllList];
          break;
        case 1:
          this.excellentCourse = [...courseVideoList];
          break;
        case 2:
          this.excellentCourse = [...courseAudioList];
          break;
        case 3:
          this.excellentCourse = [...coursePicList];
          break;
      }
    },
    //领取优惠券
    getCoupon(couponId) {
      let $this = this;
      if (
        localStorage.getItem("enableBindPhoneInRedeemCode") == 1 &&
        !localStorage.getItem("uMobile")
      ) {
        utilJs.goBindMobile();
      } else {
        utilJs.postMethod(
          global.apiurl + "redeemCodes/collectRedeemCodeId/" + couponId,
          {source: 2}, //从首页领取
          function (res) {
            if (res.status == 8 || res.status == 15) {
              $this.$showCjToast({
                text: '领取成功',
                type: 'success'
              });
            } else if (res.status == 13) {
              utilJs.goBindMobile();
            } else {
              $this.$showCjToast({
                text: res.detail,
                type: 'warn'
              });
            }
          }
        );
      }
    },
    clickGoCourse(e) {
      //点击精品课程查看
      goDetails(this, global.ckFrom.course, '', {isList: 1}, '', 1);
    },
  },
  destroyed() {
    window.removeEventListener('scroll', this.swiperScroll);
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.m6-bg {
  background: #f4f7f9;
}
.search-bg {
  border-radius: 0.2rem;
  background: #f4f7f9;
}
.swiper-count {
  font-size: 0.5rem;
  border-radius: 0.9rem;
  color: #fff;
  position: absolute;
  bottom: 0.15rem;
  right: 0.6rem;
  left: auto;
  z-index: 100;
  width: 1.6rem;
  height: 0.7rem;
  line-height: 0.7rem;
  text-align: center;
  background-color: rgb(0, 0, 0);
  filter: alpha(opacity=40);
  -moz-opacity: 0.4; /*FF*/
  background-color: rgba(0, 0, 0, 0.4);
}
.upgrade-bg {
  border-radius: 0.3rem;
  background: #565d72;
}
.forenotice-tag {
  font-size: 0.45rem;
  color: #5393db;
  height: 0.8rem;
  line-height: 0.9rem;
  padding: 0 0.2rem;
  margin-right: 0.2rem;
  background: #f6f9fd;
}
.shop-tag {
  font-size: 0.45rem;
  color: #999;
  height: 0.8rem;
  line-height: 0.9rem;
  padding: 0 0.2rem;
  margin-right: 0.2rem;
  background: #f4f7f9;
}
.m-8 {
  margin-top: -0.2rem;
}
.c-bg-fa {
  background: #fafafa;
}
.free-tag {
  font-size: 0.3rem;
  border-radius: 0.1rem;
  height: 0.6rem;
  line-height: 0.6rem;
  padding: 0 0.1rem;
}
.c-mt6 {
  margin-top: 0.15rem;
}
.c-mt8 {
  margin-top: 0.2rem;
}
.c-mh4px {
  margin-left: 4px;
  margin-right: 4px;
}
.c-ww110 {
  width: 2.75rem;
}
.c-ww44 {
  width: 1.1rem;
}
.c-hh44 {
  height: 1.1rem;
}
.c-bd1-sblack {
  border: 1px solid #666;
}
.price-fc {
  color: #ff7225;
}

.icon-course-mark {
  position: absolute;
  bottom: 0.05rem;
  right: 0.1rem;
  width: 0.8rem;
  height: 0.8rem;
}
.c-bg-btn {
  background-color: #58a1f8;
}
.fc-vip {
  color: #e9a738;
}
.c-bd-b1-item {
  border-bottom: 1px solid #f4f4f4;
}

.icon-index-spread {
  color: #26bb82;
}
.icon-index-course {
  color: #d8bf78;
}
.icon-index-attention {
  color: #f5af5e;
}
.icon-index-column {
  color: #7fccf7;
}
.icon-index-watch {
  color: #589dee;
}
.img-course-colum {
  width: 100%;
  height: 4.5rem;
  overflow: hidden;
}
.img-database {
  width: 100%;
  height: 5.5rem;
  overflow: hidden;
}
.c-tips {
  top: 0;
  color: red;
}

.triangle-left {
  width: 0;
  height: 0;
  border-top: 0.35rem solid transparent;
  border-right: 0.3rem solid #1ba3e4;
  border-bottom: 0.35rem solid transparent;
}
div img {
  display: block;
}
.c-sc80 {
  transform: scale(0.8);
}
.c-maxh284 {
  max-height: 7.1rem;
}

.couponStyle {
  width: 6.75rem;
  box-shadow:0 0 0.65rem 0 rgba(0, 0, 0, 0.12);
}
.coupon-bg{
  background: url("../../../../public/i/wap/coupon/coupon_top.png") no-repeat;
  background-size: 100%;
  height: 2.55rem;
}
.fc-coupon{
  color: #EE6D3F;
}
.theme-bd-l2 {
  border-left: 2px solid #248afd;
}
.theme-bd-rdg1 {
  border-right: 1px dashed #e5e5e5;
}
.coupoRight .c-ww200 {
  white-space: normal;
}
.exchange-bg {
  background: url("../../../../public/i/wap/coupon/exchange_top.png") no-repeat;
  background-size: 100%;
  height: 2.55rem;
}
</style>
